<?php

namespace app\api\validate;

use app\common\validate\BaseValidate;
use think\Validate;

class RepairValidate extends BaseValidate
{

    protected $rule = [
        'repair_id'             => 'require',
        'insurance_policy_id'   => 'require',
        'express_no'            => 'require',
        'express_type'          => 'require',
        'receive_express_no'    => 'require',
        'receive_address'       => 'require',
        'receive_concate_name'  => 'require',
        'receive_concate_phone' => 'require',
        'remark'                => 'require',
        'imgs'                  => 'require',

    ];
    protected $message = [
        'repair_id.require'             => 'id不能为空',
        'insurance_policy_id.require'   => '保单id不能为空',
        'express_no.require'            => '快递单号不能为空',
        'express_type.require'          => '快递类型不能为空',
        'receive_express_no.require'    => '收货快递单号不能为空',
        'receive_address.require'       => '收货地址不能为空',
        'receive_concate_name.require'  => '收货人姓名不能为空',
        'receive_concate_phone.require' => '收货人电话不能为空',
        'remark.require'                => '备注不能为空',
        'imgs.require'                  => '图片不能为空',
    ];

    public function sceneAdd()
    {
        return $this->only(['remark', 'imgs', 'insurance_policy_id']);
    }

    public function sceneFillIn()
    {
        return $this->only([
            'repair_id',
            'express_no',
            'express_type',
            'receive_address',
            'receive_concate_name',
            'receive_concate_phone',
        ]);
    }

    public function sceneHuanxin()
    {
        return $this->only([
            'insurance_policy_id',
        ]);
    }

}